package cn.pn.project.client.base;

import cn.pn.project.pojo.base.City;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name="pn-base-provider")
@RequestMapping("/cityPositioning")
public interface CityPositioningFeign {
    /**
     * 通过城市名称查询城市信息
     * @return 全部城市集合
     */
    @PostMapping("/p/findCity")
    City findCityBycityName(@RequestParam("cityName")  String cityName);



    /**
     * 查询所有
     * @return
     * @throws Exception
     */
    @PostMapping("/p/getAllInfo")
    List<City> listCity() throws  Exception;

    /**
     * 查询销售量前10的城市
     * @return
     * @throws Exception
     */
    @PostMapping("/p/getInfoTopTen")
    List<City> listCityTopTen() throws  Exception;

    @PostMapping("/p/findAll")
    List<City> findAll() throws Exception ;
}
